from pymongo import MongoClient

def connect_to_database():
    client = MongoClient("mongodb://192.168.168.110:27017/")
    db = client['data']
    return db

# 示例使用
if __name__ == "__main__":
    db = connect_to_database()
    print("数据库连接成功")
